#ifndef QPAGEWIDGET_H
#define QPAGEWIDGET_H

#include <QMap>
#include <QString>
#include <QObject>
#include <QMetaMethod>

class QFormWidget;

struct tagFuncInfo
{
    QMetaMethod m_method;
    QString     m_info;
};

struct tagWidgetInfo
{
    QString             m_name;
    QList<tagFuncInfo>  m_funcInfo;
};

struct tagFormInfo
{
    QString                 m_name;
    QList<tagWidgetInfo>    m_widgetInfo;
    QList<tagFuncInfo>      m_funcInfo;
};

class QPageWidget: public QObject
{
    Q_OBJECT
protected:
    QPageWidget();
public:
    static QPageWidget  *pageWidget();
    static void         releasePageWidget();

    tagFormInfo         pageMethod(const QString &name);
    QStringList         pages();
public:
    void                insertPage(const QString& name,QFormWidget* page);
    void                removePage(const QString& name);
protected slots:
    void                pageDestroyed();
protected:
    static QPageWidget *m_pageWidget;
    QMap<QString,QFormWidget*> m_pages;
};

#endif // QPAGEWIDGET_H
